package com.ny.demo;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

public class Out {
    public static void main(String[] args) {
        String filePath = "1.txt";
        try (FileInputStream fis = new FileInputStream(filePath);
             InputStreamReader isr = new InputStreamReader(fis, "UTF-8");) { // 可按需指定编码，如GBK等
            int data;
            while ((data = isr.read()) != -1) {
                System.out.print((char) data); // 简单打印读取字符，可按需处理
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
